
goog.provide('esn.dialog.ConsentDialog');

goog.require('esn.dialog.BaseDialog');
goog.require('esn.soy.dialog.consentDialog');


esn.dialog.ConsentDialog = function() {
  goog.base(this, 'esnConsentDialogContainer');

  this.setTitle('Consent Form');
  this.setContent(esn.soy.dialog.consentDialog.content());
  this.setModal(true);
  this.setButtons([
    esn.dialog.BaseDialog.Button.ACCEPT,
    esn.dialog.BaseDialog.Button.CANCEL    
  ]);
};
goog.inherits(esn.dialog.ConsentDialog, esn.dialog.BaseDialog);

esn.dialog.ConsentDialog.prototype.enterDocument = function() {
  goog.base(this, 'enterDocument');

  this.getHandler().listen(
      this,
      esn.dialog.BaseDialog.EventType.CANCEL,
      this.handleCancelClick_);
};

esn.dialog.ConsentDialog.prototype.handleCancelClick_ = function(e) {
  this.setVisible(false);
};
